package com.tensquare.sms;


import com.tensquare.utils.SendMessageUtil;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@RabbitListener(queues = "sms")
public class SmsListener {

    @RabbitHandler
    public void SmsListener(Map<String,String> message){
        //孙 修改
        SendMessageUtil.sendMessage(message.get("mobile"),message.get("checkcode"),"TP1711063");
        System.out.println("手机号："+message.get("mobile"));
        System.out.println("验证码："+message.get("checkcode"));
    }
}
